/**
 * 供货商   商品
 */
const mongoose = require("mongoose")
const ObjectId = mongoose.Schema.Types.ObjectId;

const SupplierGoodsSchema = new mongoose.Schema({
    supplierId: {      //供应商编号
        type: ObjectId,
        ref: "Supplier"
    },
    name: String, //商品品牌名   show
    category: String, //商品种类  show
    material: String, //材质
    appliedBottle: String, //适用规格   show
    exclusiveBottle: String, //专属规格
    packingSize: Number, //包装规格 kg
    taste: String, //口味   show
    specialFunction: String, //特殊功用
    placeOfOrigin: String, //产地   show
    productionDate: String, //生产日期
    expirationDate: Number, //保质期 月
    declare: String, //特色说明
    price: Number, //销售价格
    picture: String, //商品图片   show
    sellNum: Number, //销量
    sellMoney: Number//批发价格     show
}, {
        versionKey: false,
        timestamps: {
            createdAt: 'createTime',
            updatedAt: 'updateTime'
        } //自动管理修改时间
    })


module.exports = mongoose.model("SupplierGoods", SupplierGoodsSchema);